package com.itheima.health.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.health.entity.Result;
import com.itheima.health.pojo.Permission;
import com.itheima.health.service.PermissionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <dd>描述: ~ PermissionContrller</dd>
 * <dd>创建时间：  15:32 2020/10/9</dd>
 * <dd>创建人： yuzhiguo</dd>
 * <dt>版本历史: </dt>
 * Date         Author         Version     Description
 * ------------------------------------------------------------------
 * 2020/10/9     yuzhiguo         1.0        1.0 Version
 */
@RestController
@RequestMapping("/permission")
@Slf4j
public class PermissionController {

    @Reference
    private PermissionService permissionService;

    /**
     * 查询所有权限
     * @return
     */
    @RequestMapping("/findAll")
    public Result findAll(){
        log.info("权限查询。。。。。。");
        List<Permission> permissions = permissionService.findAll();
        return new Result(true, "查询权限成功",permissions);
    }
}
